<?php
class View_Attribute_detail extends View_Admin_Index_Template  {
	public $oTemp;
	public function __construct($oModel){
		parent::__construct($oMode);
	}
	public function displayManagerIndex($oModel){
		$this->initTemplate($oModel);
		$this->oTemp->assign_file( 'tempMainContent', PATH_TEMPLATE_ADMIN.'html/attribute_detail_index.html' );	
		$this->oTemp->assign_file( 'search_and_filter_block', PATH_TEMPLATE_ADMIN.'html/filter_block.html' );	
		$this->oTemp->assign('pageHeding',$oModel->aLanguage[MODULE_HEADING]['attribute_detail']);
		/**
		 * toolbar setup
		 */
		$this->oTemp->assign('toobar_new','?sMod=attribute_detail.index&sAction=add_form');
		
		$this->oTemp->parse('main.toobar_new');
		$this->oTemp->assign('toobar_save',"");
		$this->oTemp->parse('main.toobar_save');
	}
	public function displayListAttribute($oModel){
		$arrayListAttribute = $oModel->getdataAttribute();
		//print_r($arrayListAttribute);
		if (is_array($arrayListAttribute)) 
			foreach ($arrayListAttribute as $itemAtt)
			{		 
				$this->oTemp->assign("rowAtt",$itemAtt);
				$this->oTemp->parse('main.LIST_ATT.rowAtt');
			}
			$this->oTemp->parse('main.LIST_ATT');
	}
	public function displayNameAttribute($oModel){
		$arrayNameAttribute = $oModel->getNameAttribute();
		
		if (is_array($arrayNameAttribute)) 
			foreach ($arrayNameAttribute as $itemAtt)
			{
				print_r($itemAtt);
				$this->oTemp->assign("row_select1",$itemAtt);
				$this->oTemp->parse('main.row_select1');
			}
			
	}
	
	public function displayInfoAttribute_update($oModel){
		
	
		$this->oTemp->assign("sAction",'edit_form');
		$rowAttribute = $oModel->getInfoAttribute();
		if (is_array($rowAttribute)) 
		//print_r($rowAttribute);
			foreach ($rowAttribute as $itemAtt)
			{		
			//	$this->oTemp->assign("at_id",$itemAtt['at_id']); 
				$this->oTemp->assign("att_name",$itemAtt['atd_name']);
				
				if ($itemAtt['atd_status']==1)
				{
				$this->oTemp->assign("att_status",'checked="checked"');
				}
				else
				{
				$this->oTemp->assign("att_status",'0');
				}
				//$this->oTemp->parse('main.LIST.rowAtt');
			}		
			
			$this->oTemp->assign_file( 'tempSelectBox', PATH_TEMPLATE_ADMIN.'html/attribute_select_box.html' );
	}
	public function displayInforAttribute_insert($oModel)
	{
	$this->oTemp->assign("sAction",'add_form');
	$this->oTemp->assign_file( 'tempSelectBox', PATH_TEMPLATE_ADMIN.'html/attribute_select_box.html' );
	}
		
	
}
?>